package com.cxy521.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cxy521.system.mapper.CxySitesMapper;
import com.cxy521.system.domain.CxySites;
import com.cxy521.system.service.ICxySitesService;

/**
 * 站点信息Service业务层处理
 * 
 * @author zzs
 * @date 2025-01-09
 */
@Service
public class CxySitesServiceImpl implements ICxySitesService 
{
    @Autowired
    private CxySitesMapper cxySitesMapper;

    /**
     * 查询站点信息
     * 
     * @param siteId 站点信息主键
     * @return 站点信息
     */
    @Override
    public CxySites selectCxySitesBySiteId(Long siteId)
    {
        return cxySitesMapper.selectCxySitesBySiteId(siteId);
    }

    /**
     * 查询站点信息列表
     * 
     * @param cxySites 站点信息
     * @return 站点信息
     */
    @Override
    public List<CxySites> selectCxySitesList(CxySites cxySites)
    {
        return cxySitesMapper.selectCxySitesList(cxySites);
    }

    /*
     * 是否存在站点子节点
     *
     * @Param [siteId] 站点ID
     * @return boolean 结果
     **/
    @Override
    public boolean hasChildBySiteId(Long siteId) {
        int result = cxySitesMapper.hasChildBySiteId(siteId);
        return result > 0;
    }

    /**
     * 新增站点信息
     * 
     * @param cxySites 站点信息
     * @return 结果
     */
    @Override
    public int insertCxySites(CxySites cxySites)
    {
        return cxySitesMapper.insertCxySites(cxySites);
    }

    /**
     * 修改站点信息
     * 
     * @param cxySites 站点信息
     * @return 结果
     */
    @Override
    public int updateCxySites(CxySites cxySites)
    {
        return cxySitesMapper.updateCxySites(cxySites);
    }

    /**
     * 删除站点信息
     * 
     * @param siteId 需要删除的站点信息主键
     * @return 结果
     */
    @Override
    public int deleteCxySitesBySiteIds(Long siteId)
    {
        return cxySitesMapper.deleteCxySitesBySiteIds(siteId);
    }

    /**
     * 删除站点信息信息
     * 
     * @param siteId 站点信息主键
     * @return 结果
     */
    @Override
    public int deleteCxySitesBySiteId(Long siteId)
    {
        return cxySitesMapper.deleteCxySitesBySiteId(siteId);
    }
}
